package cn.schoolwow.quickdao.test.module.business.user.transaction.common.flow;

import cn.schoolwow.quickdao.domain.DAO;
import cn.schoolwow.quickdao.test.entity.Role;
import cn.schoolwow.quickdao.test.entity.User;
import cn.schoolwow.quickdao.test.entity.UserRole;
import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.quickflow.flow.BusinessFlow;

public class InitialTransactionFlow implements BusinessFlow {
    @Override
    public void executeBusinessFlow(FlowContext flowContext) throws Exception {
        DAO dao = flowContext.checkInstanceData(DAO.class);

        dao.rebuild(UserRole.class);
        dao.rebuild(User.class);
        dao.rebuild(Role.class);
    }

    @Override
    public String name() {
        return "初始化事务相关表";
    }
}
